package com.oss.model;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Text;

/**
 * @author xueqiang.mi
 * @since 2010-8-1
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Site implements Serializable {
	private static final long serialVersionUID = -853983616366201624L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	@Persistent
	private String name;
	@Persistent
	private String author;
	@Persistent
	private String url;
	@Persistent
	private Text description;
	@Persistent
	private Date createdDate = new Date();

	public Site() {
		super();
	}

	public Site(String name, String url) {
		super();
		this.name = name;
		this.url = url;
	}

	public String getAuthor() {
		return author;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public String getDescription() {
		return description.getValue();
	}

	public Long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public String getUrl() {
		return url;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public void setDescription(String description) {
		this.description = new Text(description);
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
